package org.jeecg.modules.simulator.util;
import java.security.SecureRandom;
/**
 * @program: simulator-b20240918
 * @description:
 * @author: renzhg
 * @create: 2024-11-07 13:46
 **/
public class Random16StringGenerator  {
    private static final String CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
    private static final int LENGTH = 16;


    public static String generateRandomString() {

//        System.out.println("随机生成的字符串: " + randomString);
        SecureRandom random = new SecureRandom();
        StringBuilder sb = new StringBuilder(LENGTH);
        for (int i = 0; i < LENGTH; i++) {
            int index = random.nextInt(CHARACTERS.length());
            sb.append(CHARACTERS.charAt(index));
        }
        return sb.toString();
    }
}
